package com.gitee.slowcreator.http.retry;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author zxw
 * @date 2023/1/8 下午1:58
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HttpRetryStrategy {

    /**
     * 不重试异常
     */
    private Class<? extends Throwable>[] noRetryFor;

    /**
     * 重试异常
     */
    private Class<? extends Throwable>[] retryFor;

    /**
     * 是否遍历异常
     */
    private boolean traverseCauses;

    /**
     * 重试次数
     */
    private int retryTimes;

    /**
     * 是否开启重试
     */
    private boolean open;
}
